package com.wushijia.designpatterns.command;

/**
 * description:电灯控制器,命令调用者
 * @author yang
 * @date 2018/1/19 20:29
 */
public class LightControl {

  Command slot;

  public LightControl() {
  }

  public void setCommand(Command command) {
    this.slot = command;
  }

  public void buttonWasPressed() {
    slot.execute();
  }

}
